<template>
  <v-data-table
      :headers="headers"
      :items="desserts"
      class="elevation-1"
      disable-sort
      hide-default-footer
  >
    <!--          <template v-slot:item.calories="{ item }">-->
    <!--            <v-chip-->
    <!--                :color="getColor(item.calories)"-->
    <!--                dark-->
    <!--            >-->
    <!--              {{ item.calories }}-->
    <!--            </v-chip>-->
    <!--          </template>-->
    <template v-slot:[`item.rank`]="{ index }">
      <div class="mt-6 mb-6">
        <img style="height: 40px" v-if="index < 3" :src="rank_img[index]">
        <h3 v-else>{{ index + 1 }}</h3>
      </div>
    </template>
  </v-data-table>
</template>

<script>
export default {
  name: "InstitutionRank",
  data () {
    return {
      rank_img: [
          "https://originalfileserver.aminer.cn/sys/aminer/ranking/ranking_rank_first.png",
          "https://originalfileserver.aminer.cn/sys/aminer/ranking/ranking_rank_sen.png",
          "https://originalfileserver.aminer.cn/sys/aminer/ranking/ranking_rank_third.png"
      ],
      headers: [
        {
          text: '排名',
          align: 'center',
          value: 'rank'
        },
        {
          text: '机构名称',
          align: 'center',
          value: 'name',
        },
        {
          text: '论文数',
          align: 'center',
          value: 'paper',
        },
        {
          text: '第一作者数',
          align: 'center',
          value: 'firstAuthor',
        },
        {
          text: '引用数',
          align: 'center',
          value: 'citation',
        },
      ],
      desserts: [
        {
          name: 'IBM',
          paper: 2537,
          firstAuthor:1991,
          citation:222816,
        },
        {
          name: 'Microsoft',
          paper: 2347,
          firstAuthor:1159,
          citation:225952,
        },
        {
          name: 'Carnegie Mellon University',
          paper: 1822,
          firstAuthor:1361,
          citation:174961,
        },
        {
          name: 'Massachusetts Institute of Technology',
          paper: 1651,
          firstAuthor:1172,
          citation:268912,
        },
        {
          name: 'Stanford University',
          paper: 1495,
          firstAuthor:1086,
          citation:222051,
        },
        {
          name: 'AT&T',
          paper: 1447,
          firstAuthor:1008,
          citation:176035,
        },
        {
          name: 'University of Pittsburgh',
          paper: 1441,
          firstAuthor:1073,
          citation:117662,
        },
        {
          name: 'University of California, Berkeley',
          paper: 1224,
          firstAuthor:1147,
          citation:245959,
        },
        {
          name: 'Bell Laboratories',
          paper: 1307,
          firstAuthor:1467,
          citation:125305,
        },
        {
          name: 'Columbia University',
          paper: 1178,
          firstAuthor:1460,
          citation:106487,
        },
      ],
    }
  },
}
</script>

<style lang="scss" scoped>
.bold {
  font-weight: bold;
}
</style>